// app 全局路由配置
// auth 当前路由是否需要身份验证，默认为 true
// kAlive 当前路由是否需要缓存，默认为 true
// meta 中的数据作为 props 渲染到组件上，key 自定义

const routes = [
  {
    path: "/login",
    component: "login/login",
    auth: false,
    kAlive: false,
    meta: {
      id: 1000000001,
      title: "login",
    },
  },
  {
    path: "/",
    component: "main/authToken",
    auth: false,
    kAlive: false,
    children: [
      {
        path: "",
        redirect: "/map",
      },
      {
        path: "map",
        component: "map/mapdefault",
        auth: true,
        meta: {
          id: "010000",
          title: "map",
        },
      },
      {
        path: "queryweather",
        component: "weatherManage/queryWeather/queryWeather",
        auth: true,
        meta: {
          id: "020100",
          title: "queryweather",
        },
      },
      {
        path: "riskarea",
        component: "riskAreaManage/riskArea/riskArea",
        auth: true,
        meta: {
          id: "050100",
          title: "riskarea",
        },
      },
      {
        path: "risklevel",
        component: "riskLevelManage/riskLevel/riskLevel",
        auth: true,
        meta: {
          id: "100100",
          title: "risklevel",
        },
      },
      {
        path: "markarea",
        component: "riskQuery/markArea/markArea",
        auth: true,
        meta: {
          id: "210100",
          title: "markArea",
        },
      },
      {
        path: "riskposition",
        component: "riskQuery/riskPosition/riskPosition",
        auth: true,
        meta: {
          id: "210200",
          title: "riskPosition",
        },
      },
      {
        path: "realtimerisk",
        component: "riskQuery/realTimeRisk/realTimeRisk",
        auth: true,
        meta: {
          id: "210300",
          title: "realTimeRisk",
        },
      },
      {
        path: "emergencyevent",
        component: "emergencyManage/emergencyEvent/emergencyEvent",
        auth: true,
        meta: {
          id: "280100",
          title: "emergencyevent",
        },
      },
      {
        path: "emergencyinform",
        component: "emergencyManage/emergencyInform/emergencyInform",
        auth: true,
        meta: {
          id: "280200",
          title: "emergencyinform",
        },
      },
      {
        path: "massmsg",
        component: "emergencyManage/massMsg/massMsg",
        auth: true,
        meta: {
          id: "280300",
          title: "massmsg",
        },
      },
      {
        path: "informtemplate",
        component: "configManage/informTemplate/informTemplate",
        auth: true,
        meta: {
          id: "430100",
          title: "informtemplate",
        },
      },
      {
        path: "informconfig",
        component: "configManage/informConfig/informConfig",
        auth: true,
        meta: {
          id: "430200",
          title: "informconfig",
        },
      },
      {
        path: "autoconfig",
        component: "configManage/autoConfig/autoConfig",
        auth: true,
        meta: {
          id: "430300",
          title: "autoconfig",
        },
      },
      {
        path: "unticonfig",
        component: "configManage/untiConfig/untiConfig",
        auth: true,
        meta: {
          id: "430400",
          title: "unticonfig",
        },
      },
      {
        path: "userConfig",
        component: "permissionAdmin/user/userConfig",
        auth: true,
        meta: {
          id: "630100",
          title: "用户管理",
        },
      },
      // {
      //   path: "userConfig",
      //   component: "permissionAdmin/user/userConfig",
      //   auth: true,
      //   meta: {
      //     id: "630200",
      //     title: "人员权限配置",
      //   },
      // },
      {
        path: "role",
        component: "permissionAdmin/role/role",
        auth: true,
        meta: {
          id: "630200",
          title: "角色权限配置",
        },
      },
      {
        path: "riskmonitor",
        component: "riskmonitor/riskmonitor",
        auth: true,
        meta: {
          id: "900000",
          title: "风险监控大屏",
        },
      },
      {
        path: "*",
        component: "page-404/Page404",
        auth: false,
        kAlive: false,
        meta: {},
      },
    ],
  },
  {
    path: "*",
    component: "page-404/Page404",
    auth: false,
    kAlive: false,
    meta: {},
  },
]

export const MapRoutes = [
  {
    path: "/",
    component: "main/authToken",
    auth: false,
    kAlive: false,
    children: [
      {
        path: "markarea",
        component: "riskQuery/markArea/markArea",
        auth: false,
        kAlive: false,
        meta: {
          IsMap: true,  // 防灾防损系统打开
          id: "210100",
          title: "markArea",
        },
      },
      {
        path: "riskposition",
        component: "riskQuery/riskPosition/riskPosition",
        auth: false,
        meta: {
          IsMap: true, // 防灾防损系统打开
          id: "210200",
          title: "riskPosition",
        },
      },
      {
        path: "*",
        component: "page-404/Page404",
        auth: false,
        kAlive: false,
        meta: {},
      },
    ],
  },
]

export default routes
